﻿using System;
using System.ComponentModel.DataAnnotations;
using XStudio.XCRF.Utilities.Regex;
using XStudio.XCRF.Data.Business.Archieve;
using XStudio.XCRF.Data.Enums;

namespace XStudio.XCRF.Data.Entities
{
    /// <summary>
    /// 患者
    /// </summary>
    /// 
    [Serializable]
    public partial class Patient : BaseEntity<Patient>, IArchieve
    {
        #region 属性
        /// <summary>
        /// 身份证号码
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [RegularExpression(RegexUtil.REGEX_IDCard)]
        [MaxLength(18)]
        public string IDCard { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string Name { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(GenderTypes))]
        public byte Gender { get; set; }

        /// <summary>
        /// 就诊科室
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string TreatDepart{ get; set; }

        /// <summary>
        /// 民族
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(10)]
        public string Nationality { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        [ArchieveField]
        [DataType(DataType.Date)]
        [Column(TypeName = "date")]
        public DateTime? Birthday { get; set; }

        /// <summary>
        /// 出生地
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string BirthPlace { get; set; }

        /// <summary>
        /// 工作单位
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string Company { get; set; }

        /// <summary>
        /// 工种
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string JobKind { get; set; }
       
        /// <summary>
        /// 职业
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(50)]
        public string Job { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [ArchieveField]
        [Column(TypeName = "varchar")]
        [MaxLength(100)]
        public string Address { get; set; }

        /// <summary>
        /// 婚姻状况
        /// </summary>
        [ArchieveField]
        [EnumDataType(typeof(MarriageTypes))]
        public byte Marriage { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [ArchieveField]
        [DataType(DataType.PhoneNumber)]
        [Column(TypeName = "varchar")]
        public string Phone { get; set; }

        /// <summary>
        /// 社保号
        /// </summary>
        [ArchieveField]
        //[DataType(DataType.SocialID)]
        [Column(TypeName = "varchar")]
        public string SocialID { get; set; }
        #endregion 属性

    }
}
